package com.atguigu.gulimall.ware.controller;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.ware.entity.TestWare;
import com.atguigu.gulimall.ware.service.TestWareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
  *@Dsecriiption TODO
  *@Author liwang
  *@version 2022/9/3、17:43
**/
@Slf4j
@RestController
@RequestMapping("/v1/ware/")
public class TestWareController {

    @Autowired
    private TestWareService testWareService;


    @PostMapping("/update/qty")
    R updateQty(@RequestBody TestWare testWare){
        log.info("扣除库存数量开始");
        testWareService.updateByPrimaryKey(testWare);
        log.info("扣除库存数量结束");
        return R.ok();
    }

}
